<!-- 房屋检查 -->
<!-- 2024011新版需求
```````没有传taskid的时候，默认是必须是日常检查。有的话，把任务锁死不在可选````````
1、省市用户登录：
    1.1、日常检查:省市级用户默认选中第一个市的第一个区县，并默认选中此区县(区域选择内容为: 省市用户citycode查询结果)。区域选择时不能选中市级，否则进行提示
    1.2、其它测试检查： 定位到当前任务的第一个区县，并默认选中此区县(区域选择内容为: 测试任务citycode查询结果)
2、其它用户登录：
    日常检查+其它测试检查: 定位到当前登录用户区划，并默认选中此区划(区域选择内容为: 登录用户citycode查询结果)
 -->
<template>
<div class="HouseExamination">
    <map-container ref="mapContainer"></map-container>
    <!-- 任务名称 -->
    <div class="renwu" style="width: 60px;top: 10px;  width: calc(100% - 200px); margin: 0px 20px; height: 32px; margin: 0 10px; padding: 0 2px; background: #2b9fec; z-index: 100; position: absolute; border-radius: 15px; color: #ffffff; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; margin: auto 25%;">
        <div style="float:left;float: left; margin: 5px 4px; font-size: 14px;">任务名称：</div>
        <div style="float:left;">
            <van-dropdown-menu active-color="#1989fa">
                <van-dropdown-item get-container="body" v-model="renwuID" :options="renwuList" @change="_changeRW" />
            </van-dropdown-menu>
        </div>
    </div>
    <!-- 搜索框 -->
    <div style="top: 40px; width: calc(100% - 90px); margin: 10px 20px; height: 32px; background: #fff; z-index: 10;  position: absolute;  left: 10px; border-radius: 5px; border: 1px solid #f3f3f3;">
        <!-- 下拉框部分 -->
        <div style="float: left; height: 20px; line-height: 20px; width: 75px; margin: 5px 0px; border-right: 1px solid #f3f3f3;" @click="showPicker = true">
            <div style="height: 100%;">
                <div style="float: left;line-height: 100%;width:16px;margin-top:2px;">
                    <img src="https://nfzjszlb.jst.zj.gov.cn/security/xiala.png" />
                </div>
                <div class="sousuo-xiala-text" style="width: calc(100% - 32px); float: left; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">{{form.cityname}}</div>
            </div>
        </div>
        <!-- 文本框部分 -->
        <div style="float: left; height: 32px; line-height: 32px; width: calc(100% - 120px);">
            <van-search v-model="inputSousuo" placeholder="请输入户主姓名" :action="false" @search="_searchData('')" @clear="_searchClear" />
        </div>
        <!-- 搜索 -->
        <div style="height: 20px; float: left; float: right; padding: 0 5px; margin-top: 6px; border-left: 1px solid #f3f3f3;" @click="showHomeInspection = !showHomeInspection">
            <img src="../../../static/imgs/topsearch/shaixuan.png" />
        </div>
    </div>
    <!-- 列表 -->
    <div style="top: 50px; width: 32px;  height: 32px; background: #fff; z-index: 10; position: absolute; right: 10px; border-radius: 5px; border: 1px solid #f3f3f3;" @click="_tiaoZhuan">
        <div style="text-align: center;">
            <img style="height: 12px;" src="https://nfzjszlb.jst.zj.gov.cn/security/liebiao.png" />
        </div>
        <div style="text-align: center;font-size: 10px;line-height: 16px;">列表</div>
    </div>
    <!-- 筛选 -->
    <div v-show="!showHomeInspection && urlTask!={}">
        <home-inspection ref="homeinspection" :cityCode="form.citycode" :data="JSON.stringify(urlTask)" style=" z-index: 100; position: absolute;"></home-inspection>
    </div>
    <!-- 区域下拉框-弹框 -->
    <van-popup v-model="showPicker" position="bottom">
        <van-cascader v-model="form.citycode" title="选择所属区域" :options="options" @change="_onChange" @finish="" :closeable="false" style="position: relative;" />
        <span style="position: absolute; top: 0%; right: 10px;font-size: 16px;height: 48px;line-height: 48px;" @click="_closeTK">确定</span>
    </van-popup>
    <!-- 搜索结果-底部弹框 -->
    <div v-show="showTK" class="sousuo-content" style="width:100vw;height:40vh;background:#ffffff;z-index:99;position: fixed;bottom: 0;overflow-y: auto;">
        <div style="height: 4vh; background: #1989fa;" @click="showTK=false,ListDataOption=[]">
            <img src="https://nfzjszlb.jst.zj.gov.cn/security/close.png" style="margin:1vh 2vw;float: right;" />
        </div>
        <van-list v-show="ListDataOption.length > 0" v-model="loading" :offset="4" :finished="finished" @load="_onLoad" finished-text="没有更多了" class="toBeCheckedList-middle1">
            <van-cell v-for="(item, index) in ListDataOption" :key="index" @click="_oneListClick(item)">
                <ul class="toBeCheckedList-middle">
                    <li class="toBeCheckedList-middle4">户主姓名：{{ item.cqr }}</li>
                    <li class="toBeCheckedList-middle4">自建房排查编号：{{ item.yhfwbh }}
                        <span style="float: right" v-show="item.taskStatus == 0">未检查</span>
                        <span style="float: right" v-show="item.taskStatus == 1">已检查</span>
                    </li>
                    <li class="toBeCheckedList-middle4">检查人：{{ item.checkUser }}</li>
                    <li class="toBeCheckedList-middle4">地址：{{ item.address }}</li>
                    <li class="toBeCheckedList-middle4">核查结论：{{ item.checkFirstResultName }}</li>
                    <li class="toBeCheckedList-middle4">房屋用途：{{ item.fwyt }}</li>
                    <li class="toBeCheckedList-middle4">检查时间：{{ item.checkTime }}</li>

                </ul>
            </van-cell>
        </van-list>
        <div v-show="ListDataOption.length == 0" style="height: 4vh; line-height: 4vh; font-size: 14px; color: #969799; text-align: center;">
            暂无数据
        </div>
    </div>
</div>
</template>

<script>
import dd from 'gdt-jsapi'
import Pubsub from 'pubsub-js'
import * as api from '../../utils/api_gis'
import {
    GetAdministrative,
    getDatalistForTree,
} from '../../utils/api'
import * as esriLoader from "esri-loader";
import MapManager from "../../core/mapManager"
import MapContainer from './MapContainer'
import homeInspection from "../activity/ConstructionInspection/homeInspection"
export default {
    data() {
        return {
            //详情跳转后的回显
            rowguid: "",
            isIquery: false,
            ifEcho: false,
            renwuID: -1,
            renwuName: "",
            renwuList: [],
            //区县选择-用于定位
            showPicker: false,
            citycode: "",
            cityname: "",
            // CountyData: [],
            options: [],
            form: {
                cityname: "选择区域",
                citycode: "",
            },
            //底部详情框
            showTK: false,
            inputSousuo: "",
            startPage: 0,

            loading: false,
            finished: false,
            ListDataOption: [],

            //省市用户登录相关
            // phoneData: {
            //     citycode: "", //用户所在citycode
            //     cityname: "", //用户所在cityname
            //     geometry: {}, //用户所在位置用来定位
            // },
            onFinishData: {
                citycode: "", //用户所在citycode
                cityname: "", //用户所在cityname
            },
            urlTask: {}, //地址栏传参的任务

            //筛选相关参数
            showHomeInspection: true,
            filterData: '',
            //当前定位
            geometryHX: null,
            rowguid: "",

        };
    },

    components: {
        MapContainer,
        homeInspection
    },

    computed: {},
    //注意：修改组件请添加对应的修改版本、日期、功能、注释！！！！
    //方法：方法命名请以下划线_开头！！！！
    //其它项复制粘贴过来的代码，请将无用的参数删除，一个js类用到一个方法不要粘整个js过来！！！！
    methods: {
        //初始化判断是store是否存在，判断是第一次打开，还是返回回显
        _echo() {
            let search = this.$store.state.HouseExaminationSearch //返回页面取出来
            if (typeof (search) != "undefined") {
                if (typeof (search.citycode) != "undefined" && typeof (search.cityname) != "undefined" && typeof (search.inputSousuo) != "undefined" && typeof (search.filterData) != "undefined" && typeof (search.renwuID) != "undefined") {
                    this.form.citycode = search.citycode
                    this.form.cityname = search.cityname
                    this.filterData = search.filterData
                    this.inputSousuo = search.inputSousuo
                    setTimeout(()=>{
                        this.renwuID = search.renwuID
                    },2000)
                    this.renwuID = search.renwuID
                    this.geometryHX = search.geometryHX
                    this.rowguid = search.rowguid
                    if (search.isIquery == true) {
                        Pubsub.publish("openQuqry");
                        this._searchData(search.rowguid)
                    } else {
                        this._searchData('')
                    }
                    this._locationHX(this.geometryHX)
                    this.ifEcho = false
                }
            }

        },
        //获取url地址中的某一个参数值
        _getUrlParam(paraName) {
            var url = decodeURI(document.location.toString());
            var arrObj = url.split("?");

            if (arrObj.length > 1) {
                var arrPara = arrObj[1].split("&");
                var arr;
                for (var i = 0; i < arrPara.length; i++) {
                    arr = arrPara[i].split("=");
                    if (arr != null && arr[0] == paraName) {
                        return arr[1];
                    }
                }
                return "";
            } else {
                return "";
            }
        },
        //列表跳转
        _tiaoZhuan() {
            this.ifEcho = false;
            this.$router.push({
                path: '/CityList'
            })
        },
        //获取任务名称(默认选中必须是“日常检查”，日常检查的type=1)
        async _getRenwuName() {
            const self = this
            let params = {
                "pageNum": 1,
                "pageSize": 100,
                "cityCode": self.citycode,
            }
            const webResult = await api.taskList(params);
            self.renwuList = webResult.data.data.pageList
            self.renwuList.forEach(item => {
                item.text = item.name
                item.value = item.id
            })
            webResult.data.data.pageList.forEach(item => {
                if (item.type == 1) {
                    self.renwuName = item["name"]
                    self.renwuID = item["id"]
                    self.urlTask = item
                }
            })
        },
        //切换任务
        _changeRW(command) {
            const self = this
            let task = self.renwuList.find(item => {
                return item.value == command;
            })
            self.inputSousuo = ""
            self._closeTK();
            self._changeRWtwo(task)
        },
        _changeRWtwo: async function (task) {
            const self = this
            self.renwuName = task.name
            self.renwuID = task.id
            //1、判断当前用户是否为省市用户
            // let code = window.localStorage.getItem('citycode') + '';
            let code = task.cityCode
            if (code.substring(0, 12) == "330000000000" || code.substring(4, 12) == "00000000") { //省级or市级
                //1、判断当前任务是否是“日常检查”
                if (task.type == 1) {
                    let pcode = code
                    if (code.substring(0, 12) == "330000000000") { //省级
                        pcode = window.localStorage.getItem('citycode') + ''
                    }
                    self._getXianOpenDataView(pcode) //获取所选区域所有值
                    //定位到第一个区县
                    const res = await getDatalistForTree(pcode)
                    if (res.data.data.length > 0) {
                        self.form.citycode = res.data.data[0].citycode
                        self.form.cityname = res.data.data[0].cityname
                        self._locationQH(self.form.citycode)
                    }
                }
            } else {
                self.form.citycode = task.cityCode;
                //判断是区县、还是乡镇、还是村
                if (task.cityCode.endsWith("000000")) { //区县
                    self.form.cityname = task.countryName
                    // self._locationQH(task.cityCode) //任务citycode定位
                } else if (task.cityCode.endsWith("000")) { //乡镇
                    self.form.cityname = task.townName
                } else { //村
                    self.form.cityname = task.villageName
                }
                self._locationQH(task.cityCode) //任务citycode定位
                self._getXianOpenDataView(self.form.citycode) //获取所选区域所有值
            }
        },
        //所属区域检查
        _getXianOpenDataView: async function (data) {
            this.options = []
            const res = await getDatalistForTree(data)
            res.data.data.forEach((item) => {
                let obj = {
                    text: item.cityname,
                    value: item.citycode,
                }
                if (item.citycode.toString().substring(9, 12) !== "000") {} else {
                    obj['children'] = []
                }
                this.options.push(obj)
            })
        },
        _onChange({
            value,
            selectedOptions,
            tabIndex
        }) {
            if (value.toString().substring(9, 12) !== "000" || selectedOptions[0].isHasChild) {} else {
                this._getXZQH(value, selectedOptions, tabIndex)
            }
            this._onFinish({
                value,
                selectedOptions,
                tabIndex
            })
        },
        _onFinish({
            value,
            selectedOptions,
            tabIndex
        }) {
            this.form.cityname = selectedOptions[selectedOptions.length - 1].text;
            this.form.citycode = value
            this._locationQH(value)
        },
        _getXZQH: async function (value, selectedOptions, tabIndex) {
            const res = await GetAdministrative(value)
            selectedOptions[tabIndex].children = []
            if (res.data.data.length > 0) {
                res.data.data.forEach((element) => {
                    let obj = {
                        text: element.cityname,
                        value: element.citycode
                    }
                    if (element.citycode.toString().substring(9, 12) !== "000") {} else {
                        obj['children'] = []
                    }
                    selectedOptions[tabIndex].children.push(obj)
                })
            }
        },
        _closeTK() {
            //当前选择的citycode
            if (this.form.citycode.toString().substring(0, 12) == "330000000000" || this.form.citycode.toString().substring(4, 12) == "00000000") { //省级or市级
                this.$toast.fail('请选择到区县或区县以下')
            } else {
                this.showPicker = false;
                this.showTK = false;
                this.startPage = 0;
                this.ListDataOption = [];
                this.rowguid = "";
                this.isIquery = false;
            }
        },
        //根据头部选择中的区划进行定位
        _locationQH(code) {
            const self = this
            code += ""
            if (code.substring(0, 12) == "330000000000") { //省级
                if (window.g.MapConfiguration.InitExtent) {
                    let initExtent = new self.Extent(window.g.MapConfiguration.InitExtent);
                    self.geometryHX = initExtent //.center;
                    self.mapView.goTo({
                        target: initExtent.center,
                        // zoom: 13
                    }, {
                        easing: "ease-out",
                        duration: 1000
                    });
                }
            } else if (code.substring(4, 12) == "00000000") { //市级
                let city = self.cityDivisions.find(item => {
                    return item.attributes.code == code.substring(0, 6)
                })
                self.geometryHX = city.geometry.extent //.center
                self.mapView.goTo({
                    target: city.geometry.extent.center,
                    // zoom: 13
                }, {
                    easing: "ease-out",
                    duration: 1000
                });
            } else if (code.substring(6, 12) == "000000") { //区县
                let quxian = self.blockDivisions.find(item => {
                    return item.attributes.code == code.substring(0, 6)
                })
                if (typeof (quxian) == "undefined") {
                    quxian = self.blockDivisions.find(item => {
                        return item.attributes.code == code
                    })
                }
                self.geometryHX = quxian.geometry.extent //.center
                self.mapView.goTo({
                    target: quxian.geometry.extent.center,
                    // zoom: 16
                }, {
                    easing: "ease-out",
                    duration: 1000
                });
            } else { //村镇----只定位到区县
                let pdd = null
                self.blockDivisions.forEach(item=>{
                    let pp = item.attributes.code + ""
                    if(pp.length == 12){
                        if(pp.substring(0,6) == code.substring(0, 6)) {
                            pdd = item
                        }
                    }else{
                        if(pp == code.substring(0, 6)){
                            pdd = item
                        }
                    } 

                })
                if (typeof(pdd) != "undefined" && pdd!=null) {
                    self.geometryHX = pdd.geometry.extent //.center
                    self.mapView.goTo({
                        target: pdd.geometry.extent.center,
                        // zoom: 16
                    }, {
                        easing: "ease-out",
                        duration: 1000
                    });
                }
            }
        },
        //回显定位
        _locationHX(geometryHX) {
            const self = this
            this.$nextTick(() => {
                setTimeout(() => {
                    self.mapView.goTo({
                        target: geometryHX.center,
                        // zoom: 13
                    }, {
                        easing: "ease-out",
                        duration: 1000
                    });
                }, 2000)
            })
        },
        //加载矢量瓦片图层
        _addLayers() {
            const self = this

            let player = new self.VectorTileLayer({
                title: window.g.HouseExamination.layer.title,
                id: window.g.HouseExamination.layer.title + "_HouseExamination",
                url: window.g.HouseExamination.layer.url,
                linkFeature: window.g.HouseExamination.layer.linkFeature,
            });
            self.mapView.map.add(player)
            // //定位到图层
            // self.mapView.goTo(player.fullExtent, {
            //     easing: 'ease-out',
            //     duration: 1000
            // })
        },
        //搜索
        _searchData(fwbh) {
            this.startPage = 0
            this.ListDataOption = []
            this._onLoad(fwbh)
        },
        _onLoad(fwbh) {
            this.startPage += 1
            this._getData(fwbh)
        },
        async _getData(fwbh) {
            const self = this

            if (fwbh == "" && fwbh == undefined) {
                if (self.form.citycode == "" || self.form.citycode == undefined) {
                    this.$toast.fail('请先选择一个区域');
                    return;
                }
            }
            let params = {
                // cityCode: citycode,
                taskId: self.renwuID,
                pageNum: self.startPage,
                pageSize: 20,
            }
            if (fwbh != "" && fwbh != undefined) { //i查询，走的房屋编码字段的查询
                params.yhfwbh = fwbh
            } else { //普通的搜索
                // params.cqr = self.inputSousuo ? self.inputSousuo : self.filterData["cqr"]
                params.cityCode = self.form.citycode + ""
                if (this.filterData) {
                    let Data = this.filterData
                    for (let i in Data) {
                        if (i !== 'cityCode') {
                            if (Data[i]) {
                                params[i] = Data[i]
                            }
                        }
                    }
                }
                params.cqr = self.inputSousuo ? self.inputSousuo : self.filterData["cqr"]
            }

            self.showTK = true
            const webResult = await api.taskListList(params);
            let pageList = webResult.data.data.pageList
            this.loading = false
            if (pageList.length > 0) {
                this.finished = false
                this.ListDataOption.push(...pageList)
            } else {
                this.finished = true
            }
            if (this.ListDataOption.length >= webResult.data.data.totalCount) {
                this.finished = true
            }
        },
        //搜索清空
        _searchClear() {
            this.showTK = false
            this.ListDataOption = []
        },
        //底部弹框单行单击跳转
        _oneListClick(item) {
            //跳转
            this.ifEcho = true;
            this.$router.push({
                path: '/SinceBuildings',
                query: {
                    data: JSON.stringify(item),
                    index: item.taskStatus,
                    id: this.urlTask.id,
                    type: 'map',
                },
            })
        },

        //···········2024011新版需求············
        //初始化判断当前用户级别,进行相关的定位
        _getCityLevelToLocation() {
            const self = this
            let code = window.localStorage.getItem('citycode') + '';
            if (code.substring(0, 12) == "330000000000") { //省级
                self._getIPxy("省", code);
            } else if (code.endsWith("00000000")) { //市级
                self._getIPxy("市", code);
            } else { //其它区域
                self.form.citycode = self.citycode
                //判断是区县、还是乡镇、还是村
                if (task.cityCode.endsWith("000000")) { //区县
                    self.form.cityname = task.countryName
                } else if (task.cityCode.endsWith("00")) { //乡镇
                    self.form.cityname = task.townName
                } else { //村
                    self.form.cityname = task.villageName
                }
                self._locationQH(code)
            }
        },
        //省级或者市级，默认选中第一个市的第一个区县
        _getIPxy: async function (type, code) {
            const self = this
            //如果是省的，默认第一个市就是杭州市，直接用杭州的citycode就可以了
            let pcode = code
            if (type == "省") {
                pcode = window.localStorage.getItem('citycode') + '';
            }
            const res = await getDatalistForTree(pcode)
            if (res.data.data.length > 0) {
                self.form.citycode = res.data.data[0].citycode+""
                self.form.cityname = res.data.data[0].cityname
                self._locationQH(self.form.citycode)
            }
        },

    },

    beforeRouteLeave(to, from, next) {
        if (this.ifEcho) {
            //离开路由时把位置存起来
            this.$store.state.HouseExaminationSearch = {
                citycode: this.form.citycode + "",
                cityname: this.form.cityname,
                inputSousuo: this.inputSousuo,
                filterData: this.filterData,
                renwuID: this.renwuID,
                geometryHX: this.geometryHX,
                isIquery: this.isIquery,
                rowguid: this.rowguid
            }
        } else {
            this.$store.state.HouseExaminationSearch = {}
        }
        next()
    },

    mounted() {
        const self = this

        dd.ready(function () {
            dd.setTitle({
                    title: '房屋检查',
                })
                .then((res) => {})
                .catch((err) => {
                    console.error(err)
                })
        })

        self.homeInspectionFilter = Pubsub.subscribe("homeInspectionFilter", (msg, data) => {
            self.finished = false
            // self.startPage = 0;
            self.filterData = data;
            self.showHomeInspection = true;
            self._searchData("")
        })

        //1、开始初始化地图相关内容
        MapManager.getMapViewByIDAsy("mainMap").then((mapView) => {
            self.mapView = mapView;
            esriLoader
                .loadModules([
                    "esri/layers/MapImageLayer",
                    "esri/layers/FeatureLayer",
                    "esri/layers/GraphicsLayer",
                    "esri/layers/TileLayer",
                    "esri/layers/VectorTileLayer",
                    "esri/Graphic",
                    "esri/geometry/Extent",
                    "esri/geometry/Point",
                    "esri/geometry/Polyline",
                    "esri/geometry/Polygon",
                    "esri/core/watchUtils",
                    "esri/geometry/geometryEngine",
                ])
                .then(
                    ([
                        MapImageLayer,
                        FeatureLayer,
                        GraphicsLayer,
                        TileLayer,
                        VectorTileLayer,
                        Graphic,
                        Extent,
                        Point,
                        Polyline,
                        Polygon,
                        watchUtils,
                        geometryEngine,
                    ]) => {
                        self.MapImageLayer = MapImageLayer;
                        self.FeatureLayer = FeatureLayer;
                        self.GraphicsLayer = GraphicsLayer;
                        self.TileLayer = TileLayer;
                        self.VectorTileLayer = VectorTileLayer;
                        self.Graphic = Graphic;
                        self.Extent = Extent
                        self.Point = Point;
                        self.Polyline = Polyline;
                        self.Polygon = Polygon;
                        self.watchUtils = watchUtils;
                        self.geometryEngine = geometryEngine;
                        //添加市级、区县要素
                        self.cityDivisions = MapManager.getAdministrativeDivisions()
                        self.blockDivisions = MapManager.getAdministrativeDivisions(1)
                        self._addLayers()

                        self.citycode = window.localStorage.getItem('citycode')+""
                        self.cityname = window.localStorage.getItem('cityName')+""
                        self._getRenwuName() //获取任务列表
                        if (typeof(self.$store.state.HouseExaminationSearch) != "undefined" && JSON.stringify(self.$store.state.HouseExaminationSearch)!="{}") { //回显
                            self.$nextTick(() => {
                                self._echo()
                            })
                        }else {
                            // //2、获取当前用户级别
                            // self.citycode = window.localStorage.getItem('citycode')+""
                            // self.cityname = window.localStorage.getItem('cityName')+""
                            if (self.citycode == null) {
                                self.citycode = self._getUrlParam("citycode")
                            }
                            if (self.cityname == null) {
                                self.cityname = self._getUrlParam("cityname")
                            }
                            //3、请看不同用户登录进来的需求！！！省市用户默认选中“日常检查”，所以这里的默认就是可以统一设置成localStorage中的值
                            self._getXianOpenDataView(self.citycode) //获取所选区域所有值
                            self.$nextTick(() => {
                                setTimeout(() => {
                                    self._getCityLevelToLocation()
                                }, 1000)
                            })
                            setTimeout(() => {
                                if (typeof (self.$route.query.task) != "undefine") {
                                    self.urlTask = JSON.parse(self.$route.query.task)
                                    self._changeRWtwo(self.urlTask)
                                }
                            }, 2000);
                        }
                    }
                );
        });
        self.mapPopupFeatureHander = Pubsub.subscribe("mapPopupFeature", (msg, data) => {
            if (data) {
                self.isIquery = true;
                self.geometryHX = data.geometry.extent
                if ((data.attributes['自建房排查编号'] != "" && typeof (data.attributes['自建房排查编号']) != "undefined")) {
                    self._searchData(data.attributes['自建房排查编号'])
                } else if ((data.attributes['yhfwbh'] != "" && typeof (data.attributes['yhfwbh']) != "undefined")) {
                    self._searchData(data.attributes['yhfwbh'])
                }
            }
        })
        self.colseBottomTKHander = Pubsub.subscribe("closeBottomTK", (msg, data) => {
            self.showTK = false
            self.ListDataOption = []
        })
        self.clearIQuqryHander = Pubsub.subscribe("clearIQuqry", (msg, data) => {
            self.rowguid = ""
            self.geometryHX = null
        })

    },

    // updated() {
    //     const self = this
    //     self.$nextTick(() => {
    //         //界面全部加载以后，如果地址栏中有taskId，把任务给我锁死
    //         if (self.urlTaskid != "") {
    //             let task = self.renwuList.find(item => {
    //                 return item.id == self.urlTaskid
    //             })
    //             if (task) {
    //                 self._changeRWtwo(task)
    //             }
    //         }
    //     })
    // },

    beforeDestroy() {
        this.mapView.graphics.removeAll()
        self.mapPopupFeatureHander = null
        self.colseBottomTKHander = null
    },

}
</script>

<style lang="scss">
.HouseExamination .van-search {
    padding: 0 0;
    height: 30px;
}

.HouseExamination .van-search__content {
    background: #ffffff;
    height: 30px;
}

.HouseExamination .van-search .van-cell {
    padding: 2px 0;
}

.HouseExamination .van-cell {
    line-height: 30px;
}

.HouseExamination .van-field__left-icon {
    line-height: 30px;
}

.HouseExamination .van-cell__value {
    line-height: 30px;
}

.HouseExamination .van-dropdown-menu__item {
    height: 32px;
    background: #2b9fec;
}

.HouseExamination .renwu .van-dropdown-menu__title {
    font-size: 14px;
    color: #ffffff;
}

.HouseExamination .renwu .van-ellipsis {
    font-size: 14px;
    color: #ffffff;
}

.HouseExamination .van-dropdown-item {
    z-index: 100;
}

.HouseExamination .van-dropdown-item--down {
    top: 4.5vh;
}

.HouseExamination .van-dropdown-menu__bar {
    background-color: #ffffff00;
    height: 32px;
    //margin-top: 5px;
    font-size: 14px;
}

.HouseExamination .toBeCheckedList-middle2 {
    font-size: 18px;
    font-weight: 1000;
    color: black;
    line-height: 36px;
}

.HouseExamination .toBeCheckedList-middle2 {
    font-size: 18px;
    font-weight: 1000;
    color: black;
    line-height: 36px;
}

.HouseExamination .toBeCheckedList-middle4 {
    font-size: 14px;
    color: black;
    line-height: 24px;

    span {
        float: right;
        // padding-left: 4vw;
    }
}
.HouseExamination .renwu .van-dropdown-menu{
    max-width: 90px;
    text-overflow: ellipsis;
    overflow: hidden;
}
</style>
